<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="shared/css_js::header">
	<title>jQuery WeUI</title>
	<link rel="stylesheet" type="text/css" href="/static/css/weuicss/weui.min.css"/>
</head>
<style>
	.weui-grid:after{
		border-bottom: 0;
	}
	.weui-tabbar__item.weui-bar__item_on .weui-tabbar__label{
		color: #003366;
	}
</style>
<body>

<!--底部-->
<nav class="mui-bar mui-bar-tab">
	<div class="weui-tabbar">
		<a href="/sale/order" class="weui-tabbar__item ">
			<div class="weui-tabbar__icon">
				<i class="fa fa fa-bars fa-lg" style="color: black;padding-top: 5px"></i>
			</div>
			<p class="weui-tabbar__label">主页</p>
		</a>
		<a href="/sale/saleperson" class="weui-tabbar__item weui-bar__item_on">
			<div class="weui-tabbar__icon">
				<i class="fa fa-user fa-lg" style="color: black"></i>
			</div>
			<p class="weui-tabbar__label">我的</p>
		</a>
	</div>
</nav>
<header class="mui-bar mui-bar-nav">
	<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	<h1 class="mui-title"><font size="4"><b>个人中心</b></font></h1>
</header>
<link rel="stylesheet" type="text/css" th:href="@{/css/personcss/person.css}"/>
<div class="mui-content">
	<div class="cyh_info">
		<img th:src="@{'http://apis.ikartek.com/v1/imageservice/image/get?filename='+${picurl.picurl}}"   style="margin: 1px"/>
		<div class="cyh_info_2" style="margin-top: 0px">
			<span  th:text="${username}+'   欢迎您!'"></span>
			<input type="hidden" th:value="${staffid}" id="staffid"/>
		</div>
		<div class="cyh_info_1" onclick="exitlogin()"  th:text="退出登录"></div>
	</div>
	<div class="weui-cells" style="margin-top: 0px">
		<div class="weui-cell weui-cell_access" style="line-height:1" onclick="myPerformance()">
			<div class="weui-cell__hd"><i class="fa fa-address-book" style="color: black;padding-top: 5px;padding-left:5px"></i>&nbsp;&nbsp;</div>
			<div class="weui-cell__bd">
				<p>我的业绩</p>
			</div>
			<div class="weui-cell__ft" >
				<p th:text="'本月共'+${everyMoth.allsum}+'元'"></p>
			</div>
		</div>
		<div class="weui-cell weui-cell_access"  >
			<div class="weui-cell__hd"><i class="fa fa-comments-o " style="color: black;padding-top: 5px;padding-left:5px"></i>&nbsp;&nbsp;</div>
			<div class="weui-cell__bd">
				<p>微信绑定</p>
			</div>
			<div class="weui-cell__ft" >
				<p>
					<input class="weui-input" th:if="${wxintype.wxid==null}"  th:value="解绑" id="wxid" type="text" style="border: 0px;height:15px;margin-bottom: 0px;text-align: end;" />
					<input class="weui-input" th:if="${wxintype.wxid!=null}" th:value="绑定" id="wxid" type="text" style="border: 0px;height:15px;margin-bottom: 0px;text-align: end;" />
				</p>
			</div>
		</div>
	</div>
</div>
<script>
    /*退出登录*/
    function exitlogin() {
        $.confirm("您确定要退出吗", function() {
            location.href="/sale/exit";
        })
    }
    /*我的业绩*/
    function myPerformance() {
        location.href="/sale/myPerformance";
    }
    /*微信绑定*/
    $("#wxid").select({
        title: "请选择",
        items: [
            {
                title: "绑定",
                value: "1",
            },
            {
                title: "解绑",
                value: "0",
            }
        ],
        onClose: function (result) {
            console.log(result.data.values);/*获取选中的值*/
            var wxid=result.data.values;
            mui.ajax('/sale/saveUserwxid',{
                data:{
                    wxid:wxid,
                    staffid:$("#staffid").val()
                },
                type:'get',//HTTP请求类型
                success:function(data){
                    if(data=='success'){
                        $.toptip('更新成功', 'success');
                    }else {
                        $.toptip('服务器出问题啦', 'error');
                    }
                }
            })
        },
    });
</script>
</body>
</html>
